// 玩家边框插件

string author = "Live";
string pluginName = "PlayerOutline 玩家边框插件";
string version = "1.0";

// 插件初始化
void OnPluginInit()
{
	// 设置插件信息
	PluginData::SetAuthor(author);
	PluginData::SetName(pluginName);
	PluginData::SetVersion(version);

	// 提示
	ThePresident.InfoFeed("插件:"+pluginName+"| 版本:"+version+"| 作者:"+author,false);
    // 当玩家出生时
    Events::Player::OnPlayerSpawn.Hook( @OnPlayerSpawn );
	
	ThePresident_OnMapStart();
    
}

void ThePresident_OnMapStart(){

	ThePresident_OnRoundStart();
	
}

void ThePresident_OnRoundStart()
{
    for ( int x = 0; x < Globals.GetMaxClients(); x++ )
    {
        CTerrorPlayer @pTerror = ToTerrorPlayer( x );
        if ( pTerror is null ) continue;
        if ( !pTerror.IsAlive() ) continue;
        if ( !pTerror.IsConnected() ) continue;
        if ( pTerror.GetTeamNumber() == TEAM_ZOMBIE || pTerror.GetTeamNumber() == TEAM_SPECTATOR ) continue;
        pTerror.SetOutline( TEAM_SURVIVOR, on, occlude, Color( 25, 100, 200 ) );
    }
}

HookReturnCode OnPlayerSpawn(CTerrorPlayer@ pPlayer)
{
    if( pPlayer.GetTeamNumber() == TEAM_SURVIVOR ){
        pPlayer.SetOutline( TEAM_SURVIVOR, on, occlude, Color( 25, 100, 200 ) );  
    }
    return HOOK_CONTINUE;
}